import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class TestTime {


    public static void main(String[] args) {

        String tel = "13813818979";
        // 括号表示组，被替换的部分$n表示第n组的内容
        tel = tel.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
        System.out.print(tel);

        System.out.println("=======1========");

        Calendar calendar = Calendar.getInstance();
        System.out.println("目前时间：" + calendar.getTime());
        System.out.println("Calendar时区：：" + calendar.getTimeZone().getID());
        System.out.println("user.timezone：" + System.getProperty("user.timezone"));
        System.out.println("user.country：" + System.getProperty("user.country"));
        System.out.println("默认时区：" + TimeZone.getDefault().getID());

        System.out.println(System.currentTimeMillis());

        System.out.println(new Date());

        System.out.println("========2=======");

        System.getProperties().entrySet().stream()
            .forEach(objectObjectEntry -> System.out.println(objectObjectEntry.getKey() + "=" + objectObjectEntry.getValue()));

        System.out.println("=======3========");
    }

}
